javascript:(function(){
	if (document.getElementById('mw-iframe')) {
		window.location.href = document.getElementById('mw-iframe').src;
		return;
	}
	else {
		document.body.parentNode.style.overflowY="scroll";
		document.body.style.overflowX="auto";
		document.body.style.overflowY="auto";
		try {
			document.evaluate('//div[@id="mw_city_wrapper"]/div',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).style.margin="auto";
			if(typeof FB !== 'undefined') {
				FB.CanvasClient.stopTimerToSizeToContent; 
				window.clearInterval(FB.CanvasClient._timer);
				FB.CanvasClient._timer=-1;
			}
			document.getElementById('snapi_zbar').parentNode.parentNode.removeChild(document.getElementById('snapi_zbar').parentNode);
			$('#mw_zbar').remove();
		}
		catch (fberr) {}
	}

	var version = 'RepeatJob Atlantic City v1.03 beta\n\n';
	var repeat = confirm(version+'Continue repeating when job is mastered?');

	function fireEvent(obj,evt) {
		var fireOnThis=obj;
		if (document.createEvent) {
			var evObj=document.createEvent('MouseEvents');
			evObj.initEvent(evt,true,false);
			fireOnThis.dispatchEvent(evObj);
		}
		else if (document.createEventObject) {
			fireOnThis.fireEvent('on'+evt);
		}
	}
	function clickButton() {
		if (/You will have enough energy in/.test(document.body.innerHTML)) {
			alert(version+'Ran out of energy, stopping.');
		}
		else if ((/100%/.test(document.getElementsByClassName('job-mastery-text')[0].innerHTML)) && !repeat) {
			//alert(version+'Job Mastered 100%!');
			document.getElementsByClassName('job-mastery-text')[0].innerHTML = 'Mastered 100% '+version+' stopping...';
			return;
		}
		else {
			var buttons = document.getElementsByClassName('valign-inner');
			for (var i=0;i<buttons.length;i++) {
				if (job=/StoryMobile.*?job=(\d+).*?storyId=(\d+)/.exec(buttons[i].href)) {
					fireEvent(buttons[i],'click');
					setTimeout(clickButton,2000);
				}
			}
		}
	}
	clickButton();
 })()